home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Carnage_Contest / scripts / CC Original / movement / No Wind.lua < prev    next >
Encoding:
Text File  |  2009-09-16  |  1.1 KB  |  37 lines

  1. --------------------------------------------------------------------------------
  2. -- Weapon No Wind
  3. -- Original Carnage Contest Weapon
  4. -- Script by DC, September 2009, www.UnrealSoftware.de
  5. --------------------------------------------------------------------------------
  6.  
  7. -- Setup Tables
  8. if cc==nil then cc={} end
  9. cc.nowind={}
  10.  
  11. -- Load & Prepare Ressources
  12. cc.nowind.gfx_wpn=loadgfx("weapons/nowind.png")                            -- Weapon Image
  13. setmidhandle(cc.nowind.gfx_wpn)
  14. cc.nowind.sfx_fadeout=loadsfx("windfadeout.ogg")
  15.  
  16. --------------------------------------------------------------------------------
  17. -- Weapon: No Wind
  18. --------------------------------------------------------------------------------
  19.  
  20. cc.nowind.id=addweapon("cc.nowind","No Wind",cc.nowind.gfx_wpn,0)        -- Add Weapon (0 uses)
  21.  
  22. function cc.nowind.draw()                                                -- Draw
  23.     -- Do nothing!
  24. end
  25.  
  26. function cc.nowind.attack(attack)                                        -- Attack
  27.     if (weapon_shots<=0) then
  28.         if (attack==1) then
  29.             -- Use weapon and allow to use another one afterwards (1)
  30.             useweapon(1)
  31.             weapon_shots=weapon_shots+1
  32.             -- No Wind
  33.             playsound(cc.nowind.sfx_fadeout)
  34.             wind(0.0)
  35.         end
  36.     end
  37. end